package com.cbg.base.utils;

/**
 * <pre>用户上下文</pre>
 * <small> 2018-12-30 | chenbing </small>
 */
public class UserContextHolder {
    public static ThreadLocal<String> ctx=new ThreadLocal<>();

    public static String userId(){
        return ctx.get();
    }

    public static void setUserId(String userId){
        ctx.set(userId);
    }

    public static void shutdown(){
        ctx.remove();
    }
}
